package com.taozi.netty.socketio.use.classroomchat.mapper.education;

import com.taozi.netty.socketio.use.classroomchat.entity.entity.education.ClassroomUser;
import com.taozi.netty.socketio.use.classroomchat.entity.vo.education.ClassroomChatVo;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 课堂人员中间表（用户列表/聊天列表）
 *
 * @author mingtao
 */
@Repository
public interface ClassroomUserMapper {
    /**
     * @description 根据主键id删除 - 批量删除
     * @param idList
     * @return int
     * @author mingtao
     * @date 14:40 2019/7/1
     **/
    int deleteByPrimaryKey(List<Integer> idList);

    /**
     * @description 根据主键id添加
     * @param classroomUser
     * @return int
     * @author mingtao
     * @date 14:40 2019/7/1
     **/
    int insertSelective(ClassroomUser classroomUser);

    /**
     * @description 根据主键id查询
     * @param id
     * @return com.sccddw.cpss.entity.entity.education.ClassroomUser
     * @author mingtao
     * @date 14:40 2019/7/1
     **/
    ClassroomUser selectByPrimaryKey(Integer id);

    /**
     * @description 根据用户id、课堂id查询课堂聊天人员列表
     * @param classroomChatVo
     * @return com.sccddw.cpss.entity.entity.education.ClassroomUser
     * @author mingtao
     * @date 14:40 2019/7/1
     **/
    ClassroomUser selectByUserIdAndClassroomId(ClassroomChatVo classroomChatVo);

    /**
     * @description 根据课堂id，在线状态 查询课堂聊天人员列表 人员姓名首字母排序
     * @description
     * @param classroomChatVo
     * @return java.util.List<com.sccddw.cpss.entity.entity.education.ClassroomUser>
     * @author mingtao
     * @date 16:09 2019/7/2
     **/
    List<ClassroomUser> selectByClassroomId(ClassroomChatVo classroomChatVo);

    /**
     * @description 根据主键id修改
     * @param classroomUser
     * @return int
     * @author mingtao
     * @date 14:40 2019/7/1
     **/
    int updateByPrimaryKeySelective(ClassroomUser classroomUser);

    /**
     * @description 根据用户id、课堂id修改用户状态
     * @param classroomUser
     * @return int
     * @author mingtao
     * @date 14:40 2019/7/1
     **/
    int updateByClassroomId(ClassroomUser classroomUser);

}